<?php


namespace app\api\controller;


use think\Db;

class Rechargeable extends Base
{

    /**
     * 充值卡商品列表
     * @return \think\response\Json
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\ModelNotFoundException
     * @throws \think\exception\DbException
     */
    public function index(){

        $data = Db::name('card_set')->select();
        foreach($data as $k=>$v){
            $data[$k]['createtime'] = date('Y-m-d H:i:s',$v['createtime']);
        }
        return json(array(
            'code' => 200,
            'msg' => 'success:获取成功',
            'data' => $data,
        ));
    }

}